package com.stxx.assistant.framwork.constants;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Fuzhenlei
 * @date 2025/02/07 13:38
 */
public enum DbType implements IEnum<DbType>{
    MYSQL("MYSQL","com.mysql.cj.jdbc.Driver"),
    POSTGRESQL("POSTGRESQL","org.postgresql.Driver");
    String type;
    String code;
    DbType(String name,String type){
        this.code = name;
        this.type = type;
    }

    public String getType(){
        return type;
    }

    public static List<String> getList(){
        return Arrays.stream(DataType.values()).map(item->item.code).collect(Collectors.toList());
    }

    @Override
    public String toString(){
        return code;
    }
}
